package Expe7;

/**
 * @Author sy
 * @Date 2022/10/4
 */
public class T4 {
    public static void main(String[] args) {
        Battery b1 = new Battery(100);
        Radio r1 = new Radio();
        r1.setB(b1);
        System.out.println("目前存储电量为："+r1.openRadio());
    }
}
class Battery{
    int electAmount;
    Battery(int amount){
        electAmount = amount;
    }
}
class Radio{
    Battery B;
    void setB(Battery b){
        B = b;
    }
    int openRadio(){
        return B.electAmount - 10;
    }
}
